package com.his.dictuserdef.service.Imp;

import com.his.dictuserdef.dao.DictUserdefCategoryMapper;
import com.his.dictuserdef.entity.DictUserdefCategory;
import com.his.dictuserdef.entity.DictUserdefCategory_Detailed;
import com.his.dictuserdef.service.DictUserdefCategoryService;
import com.his.dictuserdef.vo.DictUserdefCategoryVo;
import com.xiao.common.util.BeanUtil;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class DictUserdefCategoryServiceImpl implements DictUserdefCategoryService {
    @Autowired
    private DictUserdefCategoryMapper dictUserdefCategoryMapper;

    @Override
    public void insert(DictUserdefCategoryVo dictUserdefCategoryVo) {
        DictUserdefCategory dictUserdefCategory= BeanUtil.copyBean(dictUserdefCategoryVo,DictUserdefCategory.class);
        dictUserdefCategoryMapper.insertSelective(dictUserdefCategory);
    }

    @Override
    public void update(DictUserdefCategoryVo dictUserdefCategoryVo) {
        DictUserdefCategory dictUserdefCategory= BeanUtil.copyBean(dictUserdefCategoryVo,DictUserdefCategory.class);
        dictUserdefCategoryMapper.updateByPrimaryKeySelective(dictUserdefCategory);
    }

    @Override
    public void delete(String id) {
        dictUserdefCategoryMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<DictUserdefCategory_Detailed> selectAll(String hospid) {
        return dictUserdefCategoryMapper.selectAll(hospid);
    }

    @Override
    public DictUserdefCategory selectByKey(String id) {
        return dictUserdefCategoryMapper.selectByPrimaryKey(id);
    }
}
